Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dumpType() more consistent with PHPDoc types #3555

Closed
wants to merge 3 commits into from

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Oct 8, 2024

@@ -139,12 +139,7 @@ function (): string {

private function export(string $value): string
{
$escapedValue = addcslashes($value, "\0..\37");
if ($escapedValue !== $value) {
return '"' . addcslashes($value, "\0..\37\\\"") . '"';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The escape of DEL (\177) was missing.

@zonuexe zonuexe marked this pull request as draft October 8, 2024 18:15
@zonuexe zonuexe force-pushed the feature/11823 branch 4 times, most recently from e48bd96 to e4905f6 Compare October 8, 2024 20:30
@zonuexe zonuexe marked this pull request as ready for review October 8, 2024 20:47
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@zonuexe zonuexe changed the title Make dumpType() more consistent with PHPStan types Make dumpType() more consistent with PHPDoc types Oct 9, 2024
@ondrejmirtes
Copy link
Member

Hi, thank you for this effort, but I'm closing it because of: phpstan/phpstan#11823 (comment)

In this hypothetical \PHPStan\dumpPhpDocType() function that you can contribute, you don't need to reimplement all the escaping and so on, you can just call Type::toPhpDocNode() and print it with Printer from phpdoc-parser package.

@zonuexe zonuexe deleted the feature/11823 branch October 9, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants